﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;


namespace Automted_Bank_teller
{
    class Profile_Process : Registeration_Logic
    {
        public  string C_address;
        public  string C_phone_no;
        public  string C_gonvernment;
        public  string C_city;
        public  string C_mail;


        public void RetrieveProfileInfo()
        {

            cmd.CommandText = "Select * From Clients Where client_id ='" + global_var.G_Client_ID + "'and pin_code ='" + global_var.G_Client_PIN_Code + "'";
        }

        public void GetProfileInfo()
        {
            SqlDataReader Selector = cmd.ExecuteReader();
            if (Selector.Read())
            {
                fname = Selector.GetValue(0).ToString();
                mname = Selector.GetValue(1).ToString();
                lname = Selector.GetValue(2).ToString();
                phone = Selector.GetValue(3).ToString();
                address = Selector.GetValue(4).ToString();
                governmnet = Selector.GetValue(5).ToString();
                city = Selector.GetValue(6).ToString();
                email = Selector.GetValue(7).ToString();
                ssn = Selector.GetValue(8).ToString();
                client_id = Selector.GetValue(9).ToString();
                pin_code = Selector.GetValue(10).ToString();
                balance = float.Parse(Selector.GetValue(11).ToString());
            }

           
        }



        public void UpdateProfileInfo()
        {
            cmd.CommandText = "Update Clients Set phone ='" + C_phone_no + "',address='" + C_address + "' ,government='" + C_gonvernment + "' ,city='" + C_city + "' ,email='" +C_mail+"' Where client_id='" + global_var.G_Client_ID + "'and pin_code='" + global_var.G_Client_PIN_Code +"' ";
          
        }




    }
}
